<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<title>采购单-{$mydata.mas_no}</title>
	<include file="Public:header" />
    <link rel="stylesheet" type="text/css" href="/Public/Css/print_style.css">
	<style type="text/css">
		.input{width:130px; border:1px solid #ccc; padding:2px;}
		.input0{border:0px; padding:0px; margin:0px; height:14px; overflow:hidden;}
		.input2{border:1px solid #ccc; padding:0px; margin:1px 0px 1px 0px; height:20px; display:inline-block;}
		.select{width:180px; border:1px solid #ccc; height:25px; padding:2px;}
        .font13{font-size:13px;}
        .font14{font-size:14px;}
		.data-grid{border-collapse: collapse;}
		.data-grid .col{font-size:10px;font-family: 仿宋;}
		.data-grid .col div{width:100%;height:14px;line-height:14px;overflow:hidden;}
		<php>
		$all_width = 2;
		$print_height = C('PRINT_ROW_HEIGHT');
		$print_width = explode(',',C('PRINT_PO_WIDTH'));
		$print_css_index = 0;
		$nlbr = chr(10);
		foreach($print_width as $v){
			$all_width += (int)$v;
			echo '.col_'.$print_css_index.'{width:'.$v.'px;}'.$nlbr;
			$print_css_index++;
		}
		echo '.data-grid td{height:'.$print_height.'px;overflow:hidden;}'.$nlbr;
		echo '.print_box{width:'.$all_width.'px;margin:0px auto;}'.$nlbr;
		</php>
	</style>
    <style media="print" type="text/css">
        .paging{page-break-after:always} 
    </style>
	<script type="text/javascript">		
		var actflg="{:C('URL_MODEL')}"=="0"?"&":"?";
		
		window.onload=function()
		{
			window.print();
		}
	</script>
</head>
<body class="">
<div class="print_box">
<php>
$dataitem=$mydata_item;
$total_row=count($dataitem);
$page_index=1;
$print_pagesize=(int)C('PRINT_PAGESIZE')==''?'10000':C('PRINT_PAGESIZE');
$page_total=ceil($total_row/$print_pagesize);
$arr_index=0;
$for_index=0;
$v_amount1=0;
$all_amount=0;
foreach($dataitem as $k=>$v)
{
    $all_amount += $v['amount1'];
	$v_amount1 += $v['amount1'];
    $for_index += 1;
    if($for_index%$print_pagesize===0 || $for_index==$total_row)
    {
        $arr_amount1[$arr_index]=$v_amount1;
        $v_amount1=0;
        $arr_index += 1;
    }
}
</php>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="25%">&nbsp;</td>
    <td width="50%" align="center" style="font-size:18px;">{$web_title}<br/>采购入库验收记录</td>
    <td width="25%" align="right">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="40%">单据编号：{$mydata.mas_no}</td>
	<td>&nbsp;</td>
    <td align="right">制单时间：{$mydata.fadate|date='Y-m-d',###}</td>
  </tr>
  <tr>
    <td width="40%">供货单位：{$mydata.supplier_title}</td>
	<td width="20%">采购员：{$mydata.manager_title}</td>
    <td align="right">打印次数：第{$mydata.print_num|default='1'}次打印</td>
  </tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="2" class="data-grid">
  <tr>
    <td align="center">ID号</td>
    <td align="center">品名/型号/规格</td>
	<td align="center">监管</td>
    <td align="center">生产企业/注册证号</td>
    <td align="center">生产灭菌批号/效期</td>
    <td align="center">单位</td>    
    <td align="center">单价</td>
	<td align="center">数量</td>
    <td align="center">金额</td>
    <td align="center">质量状况</td>
    <td align="center">包装</td>
    <td align="center">复核结论</td>
  </tr>
    <php>$item_no=0;$item_pager=0;$item_limit=0;</php>
    <volist name="mydata_item" id="mydata_item" key="k">
  <tr>
    <td class="col col_0">{$mydata_item.stk_code}</td>
    <td class="col col_1"><div>{$mydata_item.stk_title}</div><div>{$mydata_item.spec}</div></td>
	<td class="col col_11" align="center">&nbsp;</td>
    <td class="col col_2"><div>{$mydata_item.madein}</div><div>{$mydata_item.approval_no}</div></td>
    <td class="col col_3"><div>{$mydata_item.batch_no}</div><div>{$mydata_item.expiry_date|get_date='Ymd',###}</div></td>
    <td class="col col_4" align="center">{$mydata_item.stk_uom}</td>
	<td class="col col_5" align="center">{$mydata_item.price|number_format=###,2,'.',''}</td>
    <td class="col col_6" align="center">{$mydata_item.qty|number_format=###,0,'.',''}</td>
    <td class="col col_7" align="center">{$mydata_item.amount1|number_format=###,2,'.',''}</td>
    <td class="col col_8" align="center">合格</td>
    <td class="col col_9" align="center">合格</td>
    <td class="col col_10" align="center">入库</td>
  </tr>
    <php>
    $item_no+=1;$item_limit+=1;
	if($item_limit%$print_pagesize===0){
		$item_limit=0;
	}
    if($item_no%$print_pagesize===0 && $item_no<$total_row)
    {
        $item_pager+=1;  
        $page_index+=1;        
    </php>
<!-- bof print page -->
  <tr>
    <td colspan="4">本单合计金额(大写)：<php>echo get_cny(get_round($all_amount));echo '('.number_format($all_amount,2,'.','').')';</php></td>
    <td colspan="8" align="right">本页小计金额(小写)：<php>echo number_format($arr_amount1[$item_pager-1],2,'.','');</php></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="25%">验收人：{$mydata.creater_username}</td>
    <td width="25%">&nbsp;</td>
    <td width="25%">入库人：{$mydata.poster_username}</td>
    <td width="25%">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td>白色：质量验收 &nbsp;&nbsp;&nbsp;&nbsp;红色：财务联 &nbsp;&nbsp;&nbsp;&nbsp;黄色：仓库留存 &nbsp;&nbsp;&nbsp;&nbsp;绿色：采购留存</td>
  </tr>
  <tr>
    <td align="center">第<php>echo $item_pager;</php>&nbsp;/&nbsp;<php>echo $page_total;</php>页</td>
  </tr>
</table>

<div class="paging"></div>

<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="25%">&nbsp;</td>
    <td width="50%" align="center" style="font-size:18px;">{$web_title}<br/>采购入库验收记录</td>
    <td width="25%" align="right">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="40%">单据编号：{$mydata.mas_no}</td>
	<td>&nbsp;</td>
    <td align="right">制单时间：{$mydata.fadate|date='Y-m-d',###}</td>
  </tr>
  <tr>
    <td width="40%">供货单位：{$mydata.supplier_title}</td>
	<td width="20%">采购员：{$mydata.manager_title}</td>
    <td align="right">打印次数：第{$mydata.print_num|default='1'}次打印</td>
  </tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="2" class="data-grid">
  <tr>
    <td align="center">ID号</td>
    <td align="center">品名/型号/规格</td>
	<td align="center">监管</td>
    <td align="center">生产企业/注册证号</td>
    <td align="center">生产灭菌批号/效期</td>
    <td align="center">单位</td>    
    <td align="center">单价</td>
	<td align="center">数量</td>
    <td align="center">金额</td>
    <td align="center">质量状况</td>
    <td align="center">包装</td>
    <td align="center">复核结论</td>
  </tr>
<!-- eof print page -->
    <php>}</php>
	</volist>
	<php>for($i=1;$i<=($print_pagesize-$item_limit);$i++){</php>
	<tr>
	<td class="col col_0" align="center">&nbsp;</td>
    <td class="col col_1" align="center">/&nbsp;&nbsp;/</td>
	<td class="col col_11" align="center">&nbsp;</td>
    <td class="col col_2" align="center">&nbsp;</td>
    <td class="col col_3" align="center">&nbsp;</td>
    <td class="col col_4" align="center">&nbsp;</td>
	<td class="col col_5" align="center">&nbsp;</td>
    <td class="col col_6" align="center">&nbsp;</td>
    <td class="col col_7" align="center">/&nbsp;&nbsp;/</td>
    <td class="col col_8" align="center">&nbsp;</td>
    <td class="col col_9" align="center">&nbsp;</td>
    <td class="col col_10" align="center">&nbsp;</td>
	</tr>
	<php>}</php>
    
  <tr>
    <td colspan="4">本单合计金额(大写)：<php>echo get_cny(get_round($all_amount));echo '('.number_format($all_amount,2,'.','').')';</php></td>
    <td colspan="8" align="right">本页小计金额(小写)：<php>echo number_format($arr_amount1[$page_index-1],2,'.','');</php></td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td width="25%">验收人：{$mydata.creater_username}</td>
    <td width="25%">&nbsp;</td>
    <td width="25%">入库人：{$mydata.poster_username}</td>
    <td width="25%">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
  <tr>
    <td>白色：质量验收 &nbsp;&nbsp;&nbsp;&nbsp;红色：财务联 &nbsp;&nbsp;&nbsp;&nbsp;黄色：仓库留存 &nbsp;&nbsp;&nbsp;&nbsp;绿色：采购留存</td>
  </tr>
  <tr>
    <td align="center">第<php>echo $page_index;</php>&nbsp;/&nbsp;<php>echo $page_total;</php>页</td>
  </tr>
</table>
<!--
<?php
echo 'print_pagesize:'.$print_pagesize.$nlbr;
echo 'item_limit:'.$item_limit.$nlbr;
?>
-->
</div>
</body>
</html>
